﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FoloCam : MonoBehaviour
{
    public GameObject playerCam;
    private Vector3 posOffset;

    private void Start()
    {
        posOffset = this.transform.position - playerCam.transform.position;
        
    }

    void Update()
    {
        if (playerCam != null)
        {
            //this.transform.position = playerCam.transform.position + posOffset;
            this.transform.rotation = Quaternion.Lerp(this.transform.rotation, playerCam.transform.rotation, 30f * Time.deltaTime);

        }
    }

}
